package cn.wolfcode.domain;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class Calculate {
    private Integer num;
    private Integer num2;
    private int type;

    @Override
    public String toString() {
        if(type==1){
            return num - num2 +"";
        }else if(type==2){
            return num * num2+"";
        }else if(type==3){
            if (num ==0 || num2==0){
                return "除数或被除数不能为0";
            }
            return num / num2 +"";
        }else if (type == 4){
            return num + num2 +"";
        } else{
            return "海城哥制作计算器,无法计算,请重新选择类型";
        }
    }
}
